/********************************************************************************
 *      Copyright:  (C) 2024 huangzhuo<1785067760@qq.com>
 *                  All rights reserved.
 *
 *       Filename:  get_data.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(2024年03月19日)
 *         Author:  huangzhuo <1785067760@qq.com>
 *      ChangeLog:  1, Release initial version on "2024年03月19日 01时33分31秒"
 *                 
 ********************************************************************************/

#ifndef GET_DATA_H
#define GET_DATA_H_H

extern int get_device_name(char *device_name, int device_len, int device_number);
extern int get_current_time(char *currentTimeStr);
extern int get_temperature(float *temp);
static inline void msleep(unsigned long ms)
{
	struct timespec cSleep;
    unsigned long ulTmp;

    cSleep.tv_sec = ms / 1000;
    if (cSleep.tv_sec == 0)
    {
        ulTmp = ms * 10000;
        cSleep.tv_nsec = ulTmp * 100;
    }
    else
    {
        cSleep.tv_nsec = 0;
    }

    nanosleep(&cSleep, 0);
    return ;
}

#endif 
